$('.back4').click(function () {
    location.href = 'designer.html'
})


console.log(location.search)


let obj = parseQuery(location.search.slice(1))
console.log(obj)
let pid = obj.uid;
if (pid) {

    let url3 = 'http://47.96.224.206:8080/CandyFirst/stylist/findByUserId'
    $.post(url3, {
        userId: pid
    }, function (data) {
        console.log(data)
        $('section').html(`<article class="banner-top">
    <div class="avatar">
        <span>
        <img src="${data.headUrl}" alt="">
        </span>
        <div>
            <b class="iconfont icon-tianjia"></b>
            <p>我的</p>
        </div>
    </div>
    <h2> ${data.nickname} </h2>
    <div class="reader">
        <span class="iconfont icon-vip-tianchong"></span>
        <p>认证设计师</p>
        <div>
            <p>总阅读</p>
            <i>48.3W</i>
            <b class="iconfont icon-wenhao"></b>
        </div>
    </div>
    <div class="fan">
        <div class="fan-top">
            <p>关注</p>
            <b>${data.attentionnum}</b>
        </div>
        <div class="fan-bottom">
            <p>粉丝</p>
            <b>${data.fansnum}</b>
        </div>

    </div>
    <p>${data.describe}</p>
    <div class="bt-bottom">
        <div>
            <a href="javascript:;">
                <h3>950</h3>
                <p>图片</p>
            </a>
            <a href="javascript:;">
                <h3>35</h3>
                <p>全屋记</p>
            </a>   
            <a href="javascript:;">
                <h3>0</h3>
                <p>文章</p>
            </a>  
            <a href="javascript:;">
                <h3>0</h3>
                <p>回答</p>
            </a>      
        </div>
    </div>
</article>
<article class="banner-bottom">
<ul class="banner-list">
    <li class="active" style="border-bottom:4px solid #FED946 "><a href="javascript:;">主页</a></li>
    <li><a href="javascript:;">动态</a></li>
    <li><a href="javascript:;">关于TA</a></li>
</ul>
<div class="bb-bottom b2" style="display:block">
    <div class="detail-top">
        <h4>服务地区</h4>
        <p>${data.servicearea}</p>
    </div>
    <div class="detail-center">
        <h4>服务报价</h4>
        <p>${data.pricefloor}-${data.priceceiling}元/m²</p>
    </div>
    <div class="detail-bottom">
        <h4>服务简介</h4>
        <p>${data.servicedescribe}</p>
    </div>
    <p></p>
    <a href="javascript:;">查看全部</a>
</div>
<div class="bb-bottom2 b2" >
    暂定页面1
</div>
<div class="bb-bottom3 b2">
    暂定页面2
</div>
</article>`)

        //选项卡功能
        let ipts = document.querySelectorAll('.banner-bottom>div')
        let lis = document.querySelectorAll('.banner-list li')
        console.log(lis)
        console.log(ipts)
        for (var i = 0; i < ipts.length; i++) {
            (function (n) {
                lis[n].onclick = function () {
                    for (var j = 0; j < ipts.length; j++) {

                        lis[j].className = ``
                        ipts[j].style.display = `none`
                        lis[j].style.borderBottom = `none`
                    }

                    this.className = `active`
                    ipts[n].style.display = `block`
                    lis[n].style.borderBottom = `4px solid #FED946`
                }


            }(i))
        }


    })
} else {
    //选项卡功能
    let ipts = document.querySelectorAll('.banner-bottom>div')
    let lis = document.querySelectorAll('.banner-list li')
    console.log(lis)
    console.log(ipts)
    for (var i = 0; i < ipts.length; i++) {
        (function (n) {
            lis[n].onclick = function () {
                for (var j = 0; j < ipts.length; j++) {

                    lis[j].className = ``
                    ipts[j].style.display = `none`
                    lis[j].style.borderBottom = `none`
                }

                this.className = `active`
                ipts[n].style.display = `block`
                lis[n].style.borderBottom = `4px solid #FED946`
            }


        }(i))
    }
}